import request from '@/utils/request';

// 获取用户列表
export async function getUserList(params?: any) {
  return request.get('/api/users', { params });
}

// 获取用户详情
export async function getUserDetail(id: string) {
  return request.get(`/api/users/${id}`);
}

// 创建用户
export async function createUser(data: any) {
  return request.post('/api/users', data);
}

// 更新用户
export async function updateUser(data: any) {
  return request.put(`/api/users/${data.id}`, data);
}

// 删除用户
export async function deleteUser(id: string) {
  return request.delete(`/api/users/${id}`);
}

// 批量删除用户
export async function batchDeleteUsers(ids: string[]) {
  return request.post('/api/users/batch-delete', { ids });
}

// 重置密码
export async function resetPassword(id: string, password: string) {
  return request.post(`/api/users/${id}/reset-password`, { password });
}
